package com.hengyue.system.domain.entity;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.hengyue.common.core.entity.BaseEntity;
import com.hengyue.common.core.entity.CoreBaseDataEntity;
import jakarta.persistence.*;
import lombok.*;
import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name = "company")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class Company extends CoreBaseDataEntity {

    /**
     * 主键ID
     * 使用雪花算法生成
     */
   /* @JsonSerialize(using = ToStringSerializer.class)
    @GeneratedValue(generator = "SnowIdGenerator")
    @GenericGenerator(type = com.hengyue.common.utils.SnowIdGenerator.class, name = "SnowIdGenerator")
    @Id
    private Long id;

    *//**
     * 公司名称
     * 最大长度100字符
     *//*
    @Column(name = "company_name", length = 100)
    private String companyName;

    *//**
     * 公司编码
     * 唯一约束，最大长度50字符
     *//*
    @Column(name = "company_code", length = 50, unique = true)
    private String companyCode;*/

    /**
     * 法定代表人
     * 最大长度50字符
     */
    @Column(name = "legal_representative", length = 50)
    private String legalRepresentative;

    /**
     * 注册资本
     */
    @Column(name = "registered_capital")
    private Double registeredCapital;

    /**
     * 经营范围
     * 使用TEXT类型存储
     */
    @Column(name = "business_scope", columnDefinition = "TEXT")
    private String businessScope;

    /**
     * 公司地址
     * 最大长度255字符
     */
    @Column(name = "address", length = 255)
    private String address;

    /**
     * 联系电话
     * 最大长度20字符
     */
    @Column(name = "contact_phone", length = 20)
    private String contactPhone;

    /**
     * 状态
     * 0-正常 1-停用
     */
    @Column(name = "status")
    private Integer status;

    /**
     * 备注
     * 最大长度500字符
     */
    @Column(name = "remark", length = 500)
    private String remark;

}
